package com.learn.designPatterns.behavioral.interpreter;

/**
 * @classname:
 * @Description:
 * @author: yfpu
 * @Date: 2018-09-17 17:33
 */
public class AndExpression extends Expression{

    private Expression expression1;
    private Expression expression2;

    public AndExpression(Expression expression1, Expression expression2) {
        this.expression1 = expression1;
        this.expression2 = expression2;
    }

    @Override
    public boolean interpret(String str) {
        return expression1.interpret(str) && expression2.interpret(str);
    }
}
